<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="http://www.lipe-home.com/js/jquery.min.js"></script>
    <script src="http://www.lipe-home.com/js/ajaxfileupload.js"></script>
    <script src="http://cdn.bootcss.com/jquery.form/3.51/jquery.form.js"></script>
    
    <script>
        function uploadLogo(id){
            $.ajaxFileUpload({
                url: 'http://www.lipe-home.com/file/uploadAnyFile.do',
                type: 'post',
                secureuri: false,             //一般设置为false
                fileElementId: id,    // 上传文件的id、name属性名
                dataType: 'json',             //返回值类型，一般设置为json、application/json
                success: function(res, status){
                    console.log(res);
                    if(res.code == "0000"){
                        $("#result").text(res.data);
                     }else{
                          alert(res.msg) ;
                    }
                },
                error: function(data, status, e){

                }
            });
        }
        
        
        var option = {
        	    url : "http://www.lipe-home.com/file/uploadAnyFile.do",
        	    type: "post",
        	    success : function(res){
        	      console.log(res);
        	      if(res.code == "0000"){
                      $("#result").text(res.data);
                   }else{
                        alert(res.msg) ;
                  }
        	   }
        	  };
        
        function test(){
        	$("#tf").ajaxSubmit(option);
        }
        
    </script>
</head>
<body>
        <input id="logofile" name="files"  class="required " type="file">
        <input  type="button" value="上传文件" onclick="uploadLogo('logofile');" ></input>
         <div>
            <span  > 下载地址 </span>
            <span id="result">  </span>
        </div>

 
 
 <form id="tf">
            <input type="file" name="files"/>
            <input type="text" name="username"/>
            <input type="button" value="提" onclick="test();"/>
        </form>
   
 </body>
</html>